﻿<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<title>HTTPS云监控</title>
		<meta name="keywords" content="Bootstrap模版,Bootstrap模版下载,Bootstrap教程,Bootstrap中文" />
		<meta name="description" content="站长素材提供Bootstrap模版,Bootstrap教程,Bootstrap中文翻译等相关Bootstrap插件下载" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<!-- basic styles -->
		<link href="/static/css/bootstrap.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="/static/css/font-awesome.min.css" />

		<!--[if IE 7]>
		  <link rel="stylesheet" href="/static/css/font-awesome-ie7.min.css" />
		<![endif]-->

		<!-- page specific plugin styles -->

		<!-- fonts -->

		<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:400,300" />

		<!-- ace styles -->

		<link rel="stylesheet" href="/static/css/ace.min.css" />
		<link rel="stylesheet" href="/static/css/ace-rtl.min.css" />
		<link rel="stylesheet" href="/static/css/ace-skins.min.css" />

		<!--[if lte IE 8]>
		  <link rel="stylesheet" href="/static/css/ace-ie.min.css" />
		<![endif]-->

		<!-- inline styles related to this page -->

		<!-- ace settings handler -->

		<script src="/static/js/ace-extra.min.js"></script>

		<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->

		<!--[if lt IE 9]>
		<script src="/static/js/html5shiv.js"></script>
		<script src="/static/js/respond.min.js"></script>
		<![endif]-->
	</head>

	<body>
		<div class="navbar navbar-default" id="navbar">
			<script type="text/javascript">
				try{ace.settings.check('navbar' , 'fixed')}catch(e){}
			</script>

			<div class="navbar-container" id="navbar-container">
				<div class="navbar-header pull-left">
					<a href="#" class="navbar-brand">
						<small>
							<i class="icon-leaf"></i>
							HTTPS云监控
						</small>
					</a><!-- /.brand -->
				</div><!-- /.navbar-header -->

				<div class="navbar-header pull-right" role="navigation">
					<ul class="nav ace-nav">
				

		

						

						<li class="light-blue">
							<a data-toggle="dropdown" href="#" class="dropdown-toggle">
								  
								<span class="user-info">
									<small>你好,</small>
									Jason
								</span>

								<i class="icon-caret-down"></i>
							</a>

							<ul class="user-menu pull-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close">
								<li>
									<a href="#">
										<i class="icon-cog"></i>
										设置
									</a>
								</li>

								<li>
									<a href="#">
										<i class="icon-user"></i>
										个人资料
									</a>
								</li>

								<li class="divider"></li>

								<li>
									<a href="#">
										<i class="icon-off"></i>
										退出
									</a>
								</li>
							</ul>
						</li>
					</ul><!-- /.ace-nav -->
				</div><!-- /.navbar-header -->
			</div><!-- /.container -->
		</div>

		<div class="main-container" id="main-container">
			<script type="text/javascript">
				try{ace.settings.check('main-container' , 'fixed')}catch(e){}
			</script>

			<div class="main-container-inner">
				<a class="menu-toggler" id="menu-toggler" href="#">
					<span class="menu-text"></span>
				</a>

				<div class="sidebar" id="sidebar">
					<script type="text/javascript">
						try{ace.settings.check('sidebar' , 'fixed')}catch(e){}
					</script>

					{% include "editnotifyrule_navlist.html" %}

					<div class="sidebar-collapse" id="sidebar-collapse">
						<i class="icon-double-angle-left" data-icon1="icon-double-angle-left" data-icon2="icon-double-angle-right"></i>
					</div>

					<script type="text/javascript">
						try{ace.settings.check('sidebar' , 'collapsed')}catch(e){}
					</script>
				</div>

				<div class="main-content">
			 

					<div class="page-content">
					 

						<div class="row">
						
					<div class="col-xs-12">
								<!-- PAGE CONTENT BEGINS -->

								<div class="alert alert-info">
									<i class="icon-hand-right"></i>
									编辑通知规则
									<button class="close" data-dismiss="alert">
										<i class="icon-remove"></i>
									</button>
								</div> 
 <div class="form-horizontal" id="policy-form"
								style="display: block;">
								<div class="form-group">
									<label class="col-sm-2 control-label"> <span
										class="require_text">*</span> 规则名称：
									</label>
									<div class="col-sm-7">
										<input readonly="true"  type="text" id="name" value="{{name}}"
											class="form-control ng-pristine ng-untouched ng-invalid ng-invalid-required">
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label"> <span
										class="require_text">*</span> 通知邮箱：
									</label>
									<div class="col-sm-7">
										<input type="text" id="email"  value="{{email}}"
											class="form-control ng-pristine ng-untouched ng-invalid ng-invalid-required"
											 >
									</div>
								</div> 

								<div class="form-group">
									<label class="col-sm-2 control-label"> <span
										class="require_text">*</span> 相同状态不重复通知:
									</label>
									<div class="col-sm-7">
										<select class="form-control" id="repeat_interval">
											<option value="1">1小时</option>
											<option value="2">2小时</option>
											<option value="3">3小时</option>
											<option value="4">4小时</option>
											<option value="5">5小时</option>
											<option value="6">6小时</option>
											<option value="7">7小时</option>
											<option value="8">8小时</option>
											<option value="9">9小时</option>
											<option value="10">10小时</option>
											<option value="11">11小时</option>
											<option value="12">12小时</option>
										</select>
									</div>


								</div>
								 
								<div class="form-group">
									<label class="col-sm-2 control-label"> <span
										class="require_text">*</span> 证书过期提醒(提前):
									</label>
									<div class="col-sm-7">
										<select class="form-control" id="expire_alert_day">
											<option value="7">7天</option>
											<option value="15">15天</option>
											<option value="30">30天</option>
											<option value="60">60天</option> 
											<option value="60">90天</option> 
										</select>
									</div>


								</div>

								<h3 class="apply_title"></h3>



								<div class="hr hr16 hr-dotted"></div>
								<div class="form-group has-info">
									<label for="inputInfo"
										class="col-xs-12 col-sm-3 control-label no-padding-right">
									</label>
									<div class="input-group col-sm-4">
										<button class="btn btn-success btn-block"
											onclick="modify()">提交修改</button>
									</div>
								</div>

							</div>
 

								<!-- PAGE CONTENT ENDS -->
							</div><!-- /.col -->
								
						 </div><!-- /row -->

								<!-- PAGE CONTENT ENDS -->
							</div><!-- /.col -->
						</div><!-- /.row -->
					</div><!-- /.page-content -->
				</div><!-- /.main-content -->

				 
			</div><!-- /.main-container-inner -->

			<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
				<i class="icon-double-angle-up icon-only bigger-110"></i>
			</a>
		</div><!-- /.main-container -->

		<!-- basic scripts -->
	<!--[if !IE]> -->

		<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>

		<!-- <![endif]-->

		<!--[if IE]>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<![endif]-->

		<!--[if !IE]> -->

		<script type="text/javascript">
			window.jQuery || document.write("<script src='/static/js/jquery-2.0.3.min.js'>"+"<"+"/script>");
		</script>

		<!-- <![endif]-->

		<!--[if IE]>
<script type="text/javascript">
 window.jQuery || document.write("<script src='/static/js/jquery-1.10.2.min.js'>"+"<"+"/script>");
</script>
<![endif]-->

		<script type="text/javascript">
			if("ontouchend" in document) document.write("<script src='/static/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
		</script>
		<script src="/static/js/bootstrap.min.js"></script>
		<script src="/static/js/typeahead-bs2.min.js"></script>

		<!-- page specific plugin scripts -->

		<script src="/static/js/date-time/bootstrap-datepicker.min.js"></script>
		<script src="/static/js/jqGrid/jquery.jqGrid.min.js"></script>
		<script src="/static/js/jqGrid/i18n/grid.locale-en.js"></script>

		<!-- ace scripts -->

	<script src="/static/js/jquery-ui-1.10.3.custom.min.js"></script>
	<script src="/static/js/jquery.ui.touch-punch.min.js"></script>
	<script src="/static/js/jquery.slimscroll.min.js"></script>
	<script src="/static/js/jquery.easy-pie-chart.min.js"></script>
	<script src="/static/js/jquery.sparkline.min.js"></script>
	<script src="/static/js/flot/jquery.flot.min.js"></script>
	<script src="/static/js/flot/jquery.flot.pie.min.js"></script>
	<script src="/static/js/flot/jquery.flot.resize.min.js"></script>
   <script src="/static/js/jquery.dataTables.min.js"></script>
	<!-- ace scripts -->

	<script src="/static/js/ace-elements.min.js"></script>
	<script src="/static/js/ace.min.js"></script>

	<script src="/static/js/bootbox.min.js"></script>
	<!-- inline scripts related to this page -->
	<script src="/static/js/highcharts.js"></script> 
	<script type="text/javascript">  
	function alert_msg(msg) { 
		  bootbox.alert({  
	            buttons: {  
	               ok: {  
	                    label: '返回',  
	                    className: 'btn-myStyle'  
	                }  
	            },  
	            message: msg,  
	            callback: function() {   
	            	window.location.href='/setting/notifyrules'
	            },   
	        });  
	};
	function modify() {
		var name = $('#name').val();
		var email = $('#email').val();
		var repeat_interval = $('#repeat_interval').val();
		var expire_alert_day = $('#expire_alert_day').val(); 

		
		var chkobj = document.getElementsByName("extern_check");
		var chkval = '';
		
		 
		 for(var i=0;i<chkobj.length;i++){  
             if(chkobj[i].checked)
             { 
            	 chkval+=chkobj[i].value+';'
             } 
        }  
		
		 if(name=="")
	     {
			 alert_msg("规则名称不能为空");
			 return;
	     }
		 if(email=="")
	     {
			 alert_msg("域名不能为空");
			 return;
	     }
		 if(repeat_interval=="")
	     {
			 alert_msg("输入不正确");
			 return;
	     }
		 if(expire_alert_day=="")
	     {
			 alert_msg("输入不正确");
			 return;
	     }
		 
		 var postData = {
				 'id':{{id}},
				 'name':name,
				 'email':email,
				 'repeat_interval':repeat_interval,
				 'expire_alert_day':expire_alert_day,  
		 }

		 $.ajax({
	        	type: 'post',
	        	async: true,
	        	url: '/setting/modifyrule',
	        	contentType: "application/json; charset=utf-8",
	        	data:JSON.stringify( postData),
	        	dataType: "json", 
	        	success: function(results){
	        		    if(results['result'])
	        		    {
	        		    	alert_msg('修改成功');
	        		    }else
	        		    {
	        		    	alert_msg(results['data']);
	        		    } 
	                	
	        	},
	        	error: function(errorMsg){
	        		 alert_msg("发生错误"); 
	        	}
	    	    }); 
		
		
	};
	
	$("#repeat_interval").val({{repeat_interval}}); 
	$("#expire_alert_day").val({{expire_alert_day}}); 
		</script>
	<div style="display:none"><script src='http://v7.cnzz.com/stat.php?id=155540&web_id=155540' language='JavaScript' charset='gb2312'></script></div>
</body>
</html>

